﻿namespace EFS.RC.SupervisorCentral.Common.Config
{
	public static class AppSettings
	{
		#region Properties

		/// Property FilterPhones: Get, Set
		public static System.String FilterPhones
		{
			get
			{
				return System.Configuration.ConfigurationManager.AppSettings["FilterPhones"];
			}
			set
			{
				// get cnfig
				System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None);

				// get filter phones
				System.Configuration.KeyValueConfigurationElement filterPhones = config.AppSettings.Settings["FilterPhones"];
				if (null == filterPhones)
				{
					filterPhones = new System.Configuration.KeyValueConfigurationElement("FilterPhones", value);
					config.AppSettings.Settings.Add(filterPhones);
				}
				else
				{
					filterPhones.Value = value;
				}

				// save & reresh
				config.Save(System.Configuration.ConfigurationSaveMode.Modified);
				System.Configuration.ConfigurationManager.RefreshSection("appSettings");
			}
		}

		#endregion
	}

}